package com.hzmct.demos;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

/**
 * @author Woong
 */
public class MainActivity extends AppCompatActivity {
    private final static String TAG = "MainActivity";

    private Button btnSerialPort;
    private Button btnGpio;
    private Button btnCan;
    private Button btnFirmware;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnSerialPort = findViewById(R.id.btn_serialport);
        btnGpio = findViewById(R.id.btn_gpio);
        btnCan = findViewById(R.id.btn_can);
        btnFirmware = findViewById(R.id.btn_firmware);

        btnSerialPort.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this, SerialPortActivity.class));
            }
        });

        btnGpio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this, GpioActivity.class));
            }
        });

        btnCan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, CanActivity.class));
            }
        });

        btnFirmware.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, FirmwareActivity.class));
            }
        });
    }
}
